package com.rd.student.jike.class1.guojiabao.Day0731;

import java.util.HashMap;
import java.util.HashSet;

public class Text02 {
    public static void main(String[] args) {
        int[] a = new int[50];
        for (int i = 0; i < a.length; i++) {
            a[i] = i+1;
        }
        int len = a.length;
        HashSet<Integer> set = new HashSet<>();
        while(set.size()<20){
            int random = (int)(Math.random() * len);
            set.add(a[random]);
        }
        System.out.println(set);
    }
}
